"""
玩具数据集
"""
# from sklearn import datasets
#
# x, y = datasets.load_iris(return_X_y=True)
#
# print(x.shape, y.shape)


"""
样本生成器
"""
from sklearn import datasets
import matplotlib.pyplot as plt

# 簇
centers = [[2,2],[8,2],[2,8],[8,8]]
x, y = datasets.make_blobs(n_samples=1000, n_features=2, centers=centers, cluster_std=1)
plt.scatter(x[:, 0], x[:, 1], s=8, c=y)
plt.show()

# 同心圆
# x, y = datasets.make_circles(n_samples=5000, noise=0.04, factor=0.7)
# plt.scatter(x[:, 0], x[:, 1], s=8, c=y)
# plt.show()

# 月牙
# x, y = datasets.make_moons(n_samples=3000, noise=0.05)
# plt.scatter(x[:, 0], x[:, 1], s=8, c=y)
# plt.show()

# 分类
# x, y =datasets.make_classification(n_classes=4, n_samples=1000, n_features=2, n_informative=2
#                                    , n_redundant=0, n_clusters_per_class=1,
#                                    n_repeated=0, random_state=22)
# plt.scatter(x[:, 0], x[:, 1], s=8, c=y)
# plt.show()
#
